﻿using JNPF.Basics.Models;
using JNPF.Utils;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace JNPF.Basics.Logic
{
    /// <summary>
    /// 定时任务
    /// 版 本：V3.0.0
    /// 版 权：引迈信息技术有限公司（https://www.jnpfsoft.com）
    /// 作 者：JNPF开发平台组
    /// 日 期：2017-12-12
    /// </summary>
    public interface TimeTaskIService
    {
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="input">请求参数</param>
        /// <returns></returns>
        Task<PageResult<TimeTaskEntity>> GetList(PageInput input);
        Task<List<TimeTaskEntity>> GetList();
        /// <summary>
        /// 列表（执行记录）
        /// </summary>
        /// <param name="requestParam">请求参数</param>
        /// <param name="taskId">任务Id</param>
        /// <returns></returns>
        Task<PageResult<TimeTaskLogEntity>> GetTaskLogList(PageInput input, string taskId);
        /// <summary>
        /// 信息
        /// </summary>
        /// <param name="id">主键值</param>
        /// <returns></returns>
        Task<TimeTaskEntity> GetInfo(string id);
        /// <summary>
        /// 验证
        /// </summary>
        /// <param name="whereLambda">条件</param>
        /// <returns></returns>
        Task<bool> IsExist(Expression<Func<TimeTaskEntity, bool>> whereLambda);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> Delete(TimeTaskEntity entity);
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> Create(TimeTaskEntity entity);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> Update(TimeTaskEntity entity);
        /// <summary>
        /// 执行记录
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        Task<int> CreateTaskLog(TimeTaskLogEntity entity);
    }
}